import React, { useEffect } from 'react'
import { useState } from 'react'

const NotFindPage = () => {
  let [lastTime,setLastTime] = useState(5)
  useEffect( ()=>{
    let newTime = setTimeout(()=>{
      if(lastTime>=0){
        setLastTime(lastTime - 1)
      }
    },1000)
    if(lastTime == 0){
      clearTimeout(newTime)
      window.history.back()
    }
  })
  return (
    <div>
        <h1>404 - 抱歉，您访问的页面不存在,{lastTime}秒之后回自动跳转至上一页面.....</h1>
    </div>
  )
}

export default NotFindPage